import axios from '@/libs/api.request'

export const imageList = (appType, page, pageSize, searchValue) => {
  const params = {
    'application_type': appType,
    'Page': page,
    'PageSize': pageSize,
    'search': searchValue
  }
  return axios.request({
    url: 'image/',
    params,
    method: 'get'
  })
}

export const imageSearch = (appType, searchValue) => {
  const params = {
    'application_type': appType,
    'search': searchValue
  }
  return axios.request({
    url: 'image/',
    params,
    method: 'get'
  })
}

export const imagePush = (remoteRepoEnv, imageIdList) => {
  const data = {
    'remote_env': remoteRepoEnv,
    'id_list': imageIdList
  }
  return axios.request({
    url: 'image/opration/',
    data,
    method: 'post'
  })
}

export const historyPushRecord = (page, appType, remoteEnv, name) => {
  const params = {
    'application_type': appType,
    'push_env': remoteEnv,
    'Page': page,
    'name': name
  }
  return axios.request({
    url: 'push_record/',
    params,
    method: 'get'
  })
}
